package com.report.bean;
// Generated Oct 13, 2013 10:19:57 AM by Hibernate Tools 3.2.1.GA


import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.validator.constraints.NotEmpty;

/**
 * Student generated by hbm2java
 */
@Entity
@Table(name="student"
,schema="public"
		)
@SequenceGenerator(name="seq", initialValue=1, allocationSize=1, sequenceName="student_seq")
public class Student  implements java.io.Serializable {


	private int id;
	private School school;
	private Clazz clazz;
	private String name;
	private Boolean gender;
	private Date birthday;
	private Float grade;

	public Student() {
	}


	public Student(int id) {
		this.id = id;
	}
	
	public Student(Boolean gender) {
		this.gender = gender;
	}
	
	public Student(int id, School school, Clazz clazz, String name, Boolean gender, Date birthday, Float grade) {
		this.id = id;
		this.school = school;
		this.clazz = clazz;
		this.name = name;
		this.gender = gender;
		this.birthday = birthday;
		this.grade = grade;
	}

	@Id 
	@Column(name="id", unique=true, nullable=false)
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="seq")
	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}
	
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="schoolid")
	public School getSchool() {
		return this.school;
	}

	public void setSchool(School school) {
		this.school = school;
	}
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="classid")
	public Clazz getClazz() {
		return this.clazz;
	}

	public void setClazz(Clazz clazz) {
		this.clazz = clazz;
	}

	@Column(name="name", length=100)
	@NotEmpty(message="not null")
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name="gender")
	public Boolean getGender() {
		return this.gender;
	}

	public void setGender(Boolean gender) {
		this.gender = gender;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="birthday", length=29)
	public Date getBirthday() {
		return this.birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	@Column(name="grade", precision=8, scale=8)
	public Float getGrade() {
		return this.grade;
	}

	public void setGrade(Float grade) {
		this.grade = grade;
	}




}


